<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>googleapiclient.http</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="googleapiclient-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="googleapiclient-module.html">Package&nbsp;googleapiclient</a> ::
        Module&nbsp;http
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="googleapiclient.http-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module http</h1><p class="nomargin-top"><span class="codelink"><a href="googleapiclient.http-pysrc.html">source&nbsp;code</a></span></p>
<pre class="literalblock">
Classes to encapsulate a single HTTP request.

The classes implement a command pattern, with every
object supporting an execute() method that does the
actuall HTTP request.

</pre>

<hr />
<div class="fields">      <p><strong>Author:</strong>
        jcgregorio@google.com (Joe Gregorio)
      </p>
</div><!-- ==================== CLASSES ==================== -->
<a name="section-Classes"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Classes</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Classes"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="googleapiclient.http.MediaUploadProgress-class.html" class="summary-name">MediaUploadProgress</a><br />
      Status of a resumable upload.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="googleapiclient.http.MediaDownloadProgress-class.html" class="summary-name">MediaDownloadProgress</a><br />
      Status of a resumable download.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="googleapiclient.http.MediaUpload-class.html" class="summary-name">MediaUpload</a><br />
      Describes a media object to upload.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="googleapiclient.http.MediaIoBaseUpload-class.html" class="summary-name">MediaIoBaseUpload</a><br />
      A MediaUpload for a io.Base objects.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="googleapiclient.http.MediaFileUpload-class.html" class="summary-name">MediaFileUpload</a><br />
      A MediaUpload for a file.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="googleapiclient.http.MediaInMemoryUpload-class.html" class="summary-name">MediaInMemoryUpload</a><br />
      MediaUpload for a chunk of bytes.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="googleapiclient.http.MediaIoBaseDownload-class.html" class="summary-name">MediaIoBaseDownload</a><br />
      &quot;Download media resources.
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="googleapiclient.http._StreamSlice-class.html" class="summary-name" onclick="show_private();">_StreamSlice</a><br />
      Truncated stream.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="googleapiclient.http.HttpRequest-class.html" class="summary-name">HttpRequest</a><br />
      Encapsulates a single HTTP request.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="googleapiclient.http.BatchHttpRequest-class.html" class="summary-name">BatchHttpRequest</a><br />
      Batches multiple HttpRequest objects into a single HTTP request.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="googleapiclient.http.HttpRequestMock-class.html" class="summary-name">HttpRequestMock</a><br />
      Mock of HttpRequest.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="googleapiclient.http.RequestMockBuilder-class.html" class="summary-name">RequestMockBuilder</a><br />
      A simple mock of HttpRequest
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="googleapiclient.http.HttpMock-class.html" class="summary-name">HttpMock</a><br />
      Mock of httplib2.Http
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="googleapiclient.http.HttpMockSequence-class.html" class="summary-name">HttpMockSequence</a><br />
      Mock of httplib2.Http
    </td>
  </tr>
</table>
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="googleapiclient.http-module.html#_retry_request" class="summary-sig-name" onclick="show_private();">_retry_request</a>(<span class="summary-sig-arg">http</span>,
        <span class="summary-sig-arg">num_retries</span>,
        <span class="summary-sig-arg">req_type</span>,
        <span class="summary-sig-arg">sleep</span>,
        <span class="summary-sig-arg">rand</span>,
        <span class="summary-sig-arg">uri</span>,
        <span class="summary-sig-arg">method</span>,
        <span class="summary-sig-arg">*args</span>,
        <span class="summary-sig-arg">**kwargs</span>)</span><br />
      Retries an HTTP request multiple times while handling errors.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="googleapiclient.http-pysrc.html#_retry_request">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="googleapiclient.http-module.html#set_user_agent" class="summary-sig-name">set_user_agent</a>(<span class="summary-sig-arg">http</span>,
        <span class="summary-sig-arg">user_agent</span>)</span><br />
      Set the user-agent on every request.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="googleapiclient.http-pysrc.html#set_user_agent">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="googleapiclient.http-module.html#tunnel_patch" class="summary-sig-name">tunnel_patch</a>(<span class="summary-sig-arg">http</span>)</span><br />
      Tunnel PATCH requests over POST.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="googleapiclient.http-pysrc.html#tunnel_patch">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Variables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="DEFAULT_CHUNK_SIZE"></a><span class="summary-name">DEFAULT_CHUNK_SIZE</span> = <code title="512* 1024">512* 1024</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="MAX_URI_LENGTH"></a><span class="summary-name">MAX_URI_LENGTH</span> = <code title="2048">2048</code>
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="_retry_request"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_retry_request</span>(<span class="sig-arg">http</span>,
        <span class="sig-arg">num_retries</span>,
        <span class="sig-arg">req_type</span>,
        <span class="sig-arg">sleep</span>,
        <span class="sig-arg">rand</span>,
        <span class="sig-arg">uri</span>,
        <span class="sig-arg">method</span>,
        <span class="sig-arg">*args</span>,
        <span class="sig-arg">**kwargs</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#_retry_request">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Retries an HTTP request multiple times while handling errors.

If after all retries the request still fails, last error is either returned as
return value (for HTTP 5xx errors) or thrown (for ssl.SSLError).

Args:
  http: Http object to be used to execute request.
  num_retries: Maximum number of retries.
  req_type: Type of the request (used for logging retries).
  sleep, rand: Functions to sleep for random time between retries.
  uri: URI to be requested.
  method: HTTP method to be used.
  args, kwargs: Additional arguments passed to http.request.

Returns:
  resp, content - Response from the http request (may be HTTP 5xx).

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="set_user_agent"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">set_user_agent</span>(<span class="sig-arg">http</span>,
        <span class="sig-arg">user_agent</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#set_user_agent">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Set the user-agent on every request.

Args:
   http - An instance of httplib2.Http
       or something that acts like it.
   user_agent: string, the value for the user-agent header.

Returns:
   A modified instance of http that was passed in.

Example:

  h = httplib2.Http()
  h = set_user_agent(h, &quot;my-app-name/6.0&quot;)

Most of the time the user-agent will be set doing auth, this is for the rare
cases where you are accessing an unauthenticated endpoint.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="tunnel_patch"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">tunnel_patch</span>(<span class="sig-arg">http</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#tunnel_patch">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Tunnel PATCH requests over POST.
Args:
   http - An instance of httplib2.Http
       or something that acts like it.

Returns:
   A modified instance of http that was passed in.

Example:

  h = httplib2.Http()
  h = tunnel_patch(h, &quot;my-app-name/6.0&quot;)

Useful if you are running on a platform that doesn't support PATCH.
Apply this last if you are using OAuth 1.0, as changing the method
will result in a different signature.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="googleapiclient-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Fri Feb 19 16:00:24 2016
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
